﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <div><a href="300001/alipay/index.html">阿里支付测试</a></div>
    <div><a href="300001/wx/index.html">微信支付测试</a></div>

    <script src="300001/wx/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript">
        (function ($) {
            $.mainu = {
                init: function () {
                    $.mainu.tradeQuery();
                },
                tradePay: function () {
                    var url = "https://localhost:44316/cgi/v2/alipay/trade/pay?uuid=e25d94c4db3c468098b34b55a52cc89d";
                    var data = {
                        subject: "美食",
                        body: "佛山",
                        total_amount: "10.50",
                        auth_code: "287481830365748474",
                        terminal_id: "A001",
                        store_id: "BA001",
                        operator_id: "1001"
                    };
                    $.ajax({
                        url: url,
                        type: "POST",
                        cache: false,
                        data: JSON.stringify(data),
                        contentType: "application/json",
                        dataType: "json",
                        error: function (XMLHttpRequest, textStatus, errorThrown) {

                        },
                        success: function (result) {
                            console.log(result);
                        }
                    });
                },
                tradeQuery: function () {
                    var url = "https://localhost:44316/cgi/v2/alipay/trade/query?uuid=e25d94c4db3c468098b34b55a52cc89d";
                    var data = {
                        trade_no: "2019110622001425081000047814",
                        out_trade_no: "2019110616340209584"
                    };
                    $.ajax({
                        url: url,
                        type: "POST",
                        cache: false,
                        data: JSON.stringify(data),
                        contentType: "application/json",
                        dataType: "json",
                        error: function (XMLHttpRequest, textStatus, errorThrown) {

                        },
                        success: function (result) {
                            console.log(result);
                        }
                    });
                }

            };
            $(function () {
                $.mainu.init();
            });
        })(jQuery);
    </script>
</body>
</html>